package org.csu.mypetstore.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.csu.mypetstore.domain.PO.Order;

public interface OrderMapper extends BaseMapper<Order> {

//    @Select("SELECT BILLADDR1 AS billAddress1, BILLADDR2 AS billAddress2, BILLCITY," +
//            "BILLCOUNTRY, BILLSTATE, BILLTOFIRSTNAME, BILLTOLASTNAME, BILLZIP, SHIPADDR1 AS shipAddress1, SHIPADDR2 AS shipAddress2," +
//            "SHIPCITY, SHIPCOUNTRY, SHIPSTATE, SHIPTOFIRSTNAME, SHIPTOLASTNAME, SHIPZIP, CARDTYPE, COURIER, CREDITCARD, " +
//            "EXPRDATE AS expiryDate, LOCALE, ORDERDATE, ORDERS.ORDERID, TOTALPRICE, USERID AS username, STATUS FROM ORDERS," +
//            "ORDERSTATUS WHERE ORDERS.USERID = #{username} AND ORDERS.ORDERID = ORDERSTATUS.ORDERID ORDER BY ORDERDATE")
//    public List<Order> getOrdersByUsername(String username);
//
//    @Select("SELECT BILLADDR1 AS billAddress1, BILLADDR2 AS billAddress2, BILLCITY, BILLCOUNTRY," +
//            "BILLSTATE, BILLTOFIRSTNAME, BILLTOLASTNAME, BILLZIP, SHIPADDR1 AS shipAddress1, SHIPADDR2 AS shipAddress2, SHIPCITY," +
//            "SHIPCOUNTRY, SHIPSTATE, SHIPTOFIRSTNAME, SHIPTOLASTNAME, SHIPZIP, CARDTYPE, COURIER, CREDITCARD, EXPRDATE AS expiryDate," +
//            "LOCALE, ORDERDATE, ORDERS.ORDERID, TOTALPRICE, USERID AS username, STATUS FROM ORDERS, ORDERSTATUS " +
//            "WHERE ORDERS.ORDERID = #{orderId} AND ORDERS.ORDERID = ORDERSTATUS.ORDERID")
//    public Order getOrder(int orderId);
//
//    @Insert("INSERT INTO ORDERS (ORDERID, USERID, ORDERDATE, SHIPADDR1, SHIPADDR2, SHIPCITY," +
//            "SHIPSTATE, SHIPZIP, SHIPCOUNTRY, BILLADDR1, BILLADDR2, BILLCITY, BILLSTATE, BILLZIP, BILLCOUNTRY, COURIER," +
//            " TOTALPRICE, BILLTOFIRSTNAME, BILLTOLASTNAME, SHIPTOFIRSTNAME, SHIPTOLASTNAME, CREDITCARD, EXPRDATE, CARDTYPE," +
//            " LOCALE) VALUES(#{order.orderId},#{order.username},#{order.orderDate},#{order.shipAddress1},#{order.shipAddress2}," +
//            "#{order.shipCity},#{order.shipState},#{order.shipZip},#{order.shipCountry},#{order.billAddress1}," +
//            "#{order.billAddress2},#{order.billCity},#{order.billState},#{order.billZip},#{order.billCountry},#{order.courier}," +
//            "#{order.totalPrice},#{order.billToFirstName},#{order.billToLastName},#{order.shipToFirstName},#{order.shipToLastName}," +
//            "#{order.creditCard},#{order.expiryDate},#{order.cardType},#{order.locale})")
//    public void insertOrder(@Param("order") Order order);
//
//    @Insert("INSERT INTO ORDERSTATUS (ORDERID, LINENUM, TIMESTAMP, STATUS) " +
//            "VALUES (#{order.orderId},#{order.orderId},\"2020-1-1\",\"P\")")
//    public void insertOrderStatus(@Param("order") Order order);

}
